package com.gmp.rooms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gmp.rooms.mapper.EquipmentInspectionMapper;
import com.gmp.rooms.domain.EquipmentInspection;
import com.gmp.rooms.service.IEquipmentInspectionService;

/**
 * 设备巡检记录Service业务层处理
 *
 * @author Koi
 * @date 2025-08-02
 */
@Service
public class EquipmentInspectionServiceImpl extends ServiceImpl<EquipmentInspectionMapper, EquipmentInspection> implements IEquipmentInspectionService {
    @Autowired
    private EquipmentInspectionMapper equipmentInspectionMapper;

    /**
     * 查询设备巡检记录
     *
     * @param id 设备巡检记录主键
     * @return 设备巡检记录
     */
    @Override
    public EquipmentInspection selectEquipmentInspectionById(String id) {
        return equipmentInspectionMapper.selectEquipmentInspectionById(id);
    }

    /**
     * 查询设备巡检记录列表
     *
     * @param equipmentInspection 设备巡检记录
     * @return 设备巡检记录
     */
    @Override
    public List<EquipmentInspection> selectEquipmentInspectionList(EquipmentInspection equipmentInspection) {
        return equipmentInspectionMapper.selectEquipmentInspectionList(equipmentInspection);
    }

    /**
     * 新增设备巡检记录
     *
     * @param equipmentInspection 设备巡检记录
     * @return 结果
     */
    @Override
    public boolean insertEquipmentInspection(EquipmentInspection equipmentInspection) {
        equipmentInspection.setCreatedAt(new java.util.Date());
        equipmentInspection.setIsDelete(0);
        return save(equipmentInspection);
    }

    /**
     * 修改设备巡检记录
     *
     * @param equipmentInspection 设备巡检记录
     * @return 结果
     */
    @Override
    public int updateEquipmentInspection(EquipmentInspection equipmentInspection) {
        return equipmentInspectionMapper.updateEquipmentInspection(equipmentInspection);
    }

    /**
     * 批量删除设备巡检记录
     *
     * @param ids 需要删除的设备巡检记录主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentInspectionByIds(String[] ids) {
        return equipmentInspectionMapper.deleteEquipmentInspectionByIds(ids);
    }

    /**
     * 删除设备巡检记录信息
     *
     * @param id 设备巡检记录主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentInspectionById(String id) {
        return equipmentInspectionMapper.deleteEquipmentInspectionById(id);
    }




}
